local juezhu = fk.CreateSkill({
  name = "kq__juezhu",
})

juezhu:addEffect("active", {
  anim_type = "offensive",
  card_num = 0,
  target_num = 1,
  prompt = "与一名攻击范围内的角色拼点",
  can_use = function(self, player)
    return player:usedSkillTimes(juezhu.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0 and to_select ~= player and player:canPindian(to_select) and player:inMyAttackRange(to_select)
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local pindian = player:pindian({target}, juezhu.name)
    local from, to
    if pindian.results[target].winner == player then
      from, to = player, target
    elseif pindian.results[target].winner == target then
      from, to = target, player
    end
    if from==player and not to.dead then
      room:useVirtualCard("stab__slash", nil, player, to, juezhu.name)
    else
      local cards = table.filter(player:getCardIds("he"), function(id)
        return Fk:getCardById(id).type ~= Card.TypeTrick
      end)
      room:recastCard(cards, player, juezhu.name)
    end
    
  end,
})


Fk:loadTranslationTable {
["kq__juezhu"] = "决诛",
[":kq__juezhu"] = "出牌阶段限一次，你可以与一名攻击范围内的角色拼点：若你赢，你视为对对方使用一张刺【杀】；若你没赢，你重铸所有非锦囊牌。",
["$kq__juezhu1"] = "",
["$kq__juezhu2"] = "",
}
return juezhu